package org.ala.tiktools.tools.list;

import java.util.List;
import java.util.function.Function;
import java.util.stream.Collectors;

/**
 * @author ala
 * @date 2025-03-21 11:31
 */
public class Lists {


    /**
     *  判断List是否为空
     */
    @SuppressWarnings("rawtypes")
	public static boolean isEmpty(List list) {return list == null || list.isEmpty();}
    /**
     *  类型转换
     */
    public static <V,E> List<V> convert(List<E> list, Function<E,V> converter) {
        return list.stream().map(converter).collect(Collectors.toList());
    }

}
